<template>
  <div style="text-align:left; margin: 20px">
    <!-- 这边分页组件 只需要将 总数 total  一页多少条数据 pagesize 多少页 currentPage 传过来即可使用 -->
    <el-pagination 
    @current-change="handleCurrentChange" 
    @size-change="handleSizeChange"
    :page-sizes="[1, 2, 5, 10]" 
    :page-size="pageSize" 
    layout="total, sizes, prev, pager, next, jumper"
    :total="total">
    </el-pagination>
     </div>
</template>

<script>
export default {
  props: {
    total: {
      type: Number,
      default: 100,
    },
    pageSize: {
      type: Number,
      default: 5,
    },
    currentPage: {
      type: Number,
      default: 1,
    },
  },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.$emit("SizeChange", val);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.$emit("Pagechange", val);
    }
  },
  created() { },
};
</script>

<style>
</style>